package com.distributeredis.redis_springboot.forAndThreadAndCompleTableFuture.controller;

import com.distributeredis.redis_springboot.forAndThreadAndCompleTableFuture.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

@RestController
@RequestMapping("/test")
public class TestCompleTableFuture {
    @Autowired
    private TestService testService;
    @PostMapping("/t1")
    public void test() throws ExecutionException, InterruptedException {
        testService.test();
    }

    @PostMapping("/t2")
    public void test2() throws Exception {
        testService.test1();
    }

    @PostMapping("/t3")
    public void test3() throws Exception {
        testService.test2();
    }

    @PostMapping("/t4")
    public void test4() throws Exception {
        testService.test3();
    }

}
